#pragma once

#include "data/FI_CIBRepoData.h"
#include "data/FI_ExchRepoData.h"
#include "data/FI_IRSData.h"
#include "data/FI_ShiborData.h"
#include "data/FI_RepoFixingData.h"
#include "data/FI_CIBRepoFixingData.h"
#include "data/FI_OMOData.h"
#include "data/FI_CNEXData.h"
#include "data/CreditDebtRankingData.h"
#include "data/FI_GMKTIndexData.h"
#include <qbmessage/include/message_bond.h>
#include <qbtools/message/MessagePoster.h>
#include <QObject>


class FIDataCenter : public QObject, public MessageReceiver
{
	Q_OBJECT
public:
	static FIDataCenter& instance();

	void reqCIBRepo();
	void reqExchRepo();
	void reqIRS();
	void reqShibor();
	void reqRepoFixing();
	void reqCIBRepoFixing();
    void reqGMktIndex(const std::vector<int> current_indexes);
	void reqPublicOption();
	void reqOMOSaveSetting();
    void reqCNEX();

protected:
 	void onDataArrived(const qb::SSAckMsg& msg) override;

signals:
	void recvCIBRepo(bool dataChange = true);
	void recvExchRepo(bool dataChange = true);
	void recvIRS(bool dataChange = true);
	void recvShibor(bool dataChange = true);
	void recvRepoFixing(bool dataChange = true);
    void recvCIBRepoFixing(bool dataChange = true);
    void recvGMktIndex(int indexID, bool dataChange = true);
    void recvCNEX();
	void recvPublicOptionReq();
	void recvPublicOptionPush();
	void recvCreditDebtRanking(int funcId);

// protected slots:
// 	void onSign();

public:
	FICIBRepoData m_dataCIBRepo;			//银银间回购
	FIExchRepoData m_dataExchRepo;			//交易所回购
	FIIRSData m_dataIRS;					//利率互换
	FIShiborData m_dataShibor;				//Shibor
	FIRepoFixingData m_dataRepoFixing;		//回购定盘
	FICIBRepoFixingData m_dataCIBRepoFixing;//银银间回购定盘
	FIOMOData m_dataOMO;

    FIGMktIndexPriceData m_dataGMktIndex;
    FICNEXData m_dataCNEX;

	CreditDebtRankingData m_dataCreditDebtRanking;//信用债异常成交

private:
	FIDataCenter();
};
